package cn.edu.hbvtc.qms.persist.hibernate;

import java.util.List;

import cn.edu.hbvtc.qms.domain.Item;
import cn.edu.hbvtc.qms.persist.IItemDao;

public class HibernateItemDao extends HibernateAbstractDao<Item, Integer>
		implements IItemDao {

	private static final long serialVersionUID = 1L;

	public HibernateItemDao() {
		super(Item.class);
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<Item> findItemsOfCategory(int categoryId) {
		return this.getHibernateTemplate().find("from Item c where c.category.id = ?",categoryId );
	}
	
}
